<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ include file="../common/header.jsp" %>

<div id="saper-container">
    <div id="saper-hd"></div>
    <div id="saper-bd">
        <div class="subfiled clearfix">
            <h2>${titleName}</h2>
        </div>
        <div class="subfiled-content">
            <form class="saper-form">
                <div class="kv-item clearfix">
                    <label>关键字:&nbsp;</label>
                    <div class="kv-item-content">
                        <input type="text" placeholder="请输入要查询的关键字"/>
                    </div>
                </div>
            </form>
            <!--表格开始-->
            <div class="table">
                <div class="table-box">
                    <table>
                        <thead>
                        <tr>
                            <th>任务编号</th>
                            <th>事件名</th>
                            <th>上报类别</th>
                            <th>事件类别</th>
                            <th>上报人</th>
                            <th>上报时间</th>
                            <th>派遣者</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                            <c:if test="${reportList==null}">
                                <td colspan="8" style="text-align: center">目前没有任务哦</td>
                            </c:if>
                        <c:forEach items="${reportList}" var="format">
                        <tr>
                            <td>${format.taskId}</td>
                            <td>${format.title}</td>
                            <td>${format.categoryName}</td>
                            <td>
                                    ${format.typeBigName}
                                <c:if test="${format.typeSmallName != null}">
                                    &nbsp;&nbsp;${format.typeSmallName}
                                </c:if>
                            </td>
                            <td>${format.reportName}</td>
                            <td>${format.createTimeName}</td>
                            <td>${format.checkManName}</td>

                            <td>
                                <button class="layui-btn layui-btn-xs" city-detail="detail" detail-id="${format.id}">详情</button>
                                <button class="layui-btn layui-btn-xs layui-btn-danger" city-event="business-complete" event-id="${format.id}">完成任务</button>
                            </td>
                        </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--表格结束-->
            <div class="pagging" style="text-align: center">
                <div class="left">共${reportNum}条记录</div>
                <div class="right">
                    <c:if test="${currentPage == 1}">
                        <span class="disabled"><< 前一页</span>
                    </c:if>
                    <c:if test="${currentPage != 1}">
                        <a href="/grid/handle?page=${currentPage-1}"><< 前一页</a>
                    </c:if>
                    <c:if test="${currentPage == 1}">
                        <span class="current">1</span>
                    </c:if>
                    <c:if test="${currentPage != 1}">
                        <a href="/grid/handle?page=1">1</a>
                    </c:if>
                    <%
                        long pageTimes = (long)session.getAttribute("pageTimes");
                        for(int i=1;i<pageTimes;i++)
                        {
                            request.setAttribute("page", i+1);

                    %>
                    <c:if test="${currentPage == page}">
                        <span class="current"><%=i+1%></span>
                    </c:if>
                    <c:if test="${currentPage != page}">
                        <a href="/grid/handle?page=<%=i+1%>"><%=i+1%></a>
                    </c:if>
                    <%} %>

                    <c:if test="${currentPage == pageTimes}">
                        <span class="disabled">后一页 >></span>
                    </c:if>
                    <c:if test="${currentPage != pageTimes}">
                        <a href="/grid/handle?page=${currentPage+1}">后一页 >></a>
                    </c:if>
                </div>
        </div>
    </div>
    <div id="saper-ft"></div>
</div>

<%@ include file="../common/footer.jsp" %>
